package com.findviewbydream.evil.eda.View.Dialog;

import android.content.Context;
import android.view.View;
import android.widget.Button;
import android.widget.LinearLayout;

import com.findviewbydream.evil.eda.R;
import com.flyco.animation.Attention.Swing;
import com.flyco.dialog.utils.CornerUtils;
import com.flyco.dialog.widget.base.BaseDialog;
import com.flyco.dialog.widget.internal.BaseAlertDialog;

/********************************************
 * 工程名：Eda
 * 包名：com.findviewbydream.evil.eda.View.Dialog
 * 时间：16-9-4 下午11:34
 * 作者：白雨濃 evil
 * 邮箱：evilbai@foxmail.com
 * 内容：
 ********************************************/
public class FeedbackDialog extends BaseAlertDialog<FeedbackDialog>
{
    private Context context;

    public FeedbackDialog(Context context)
    {
        super(context);
        this.context = context;
    }

    @Override
    public View onCreateView()
    {
        showAnim(new Swing());
        View view = View.inflate(context, R.layout.feedback_dialog, null);
        mLlContainer.addView(view);

        /** content */
        mTvContent.setPadding(dp2px(20), dp2px(0), dp2px(20), dp2px(0));
        mTvContent.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,
                LinearLayout.LayoutParams.WRAP_CONTENT));
        mLlContainer.addView(mTvContent);

        return mLlContainer;
    }

    @Override
    public void setUiBeforShow()
    {
        super.setUiBeforShow();
        /**set background color and corner radius */
        float radius = dp2px(mCornerRadius);
        mLlContainer.setBackgroundDrawable(CornerUtils.cornerDrawable(mBgColor, radius));
        mTvBtnLeft.setBackgroundDrawable(CornerUtils.btnSelector(radius, mBgColor, mBtnPressColor, -2));
        mTvBtnRight.setBackgroundDrawable(CornerUtils.btnSelector(radius, mBgColor, mBtnPressColor, -2));
        mTvBtnMiddle.setBackgroundDrawable(CornerUtils.btnSelector(radius, mBgColor, mBtnPressColor, -2));
    }
}
